home *** CD-ROM | disk | FTP | other *** search
- procedure TForm1.Print21Click(Sender: TObject);
- var
- ImWidth, ImHeight: Integer;
- begin
- Printer.BeginDoc; // Start a print job
- try
- { Calculate the image size for the destination canvas }
- ImWidth := Printer.PageWidth div 2;
- ImHeight := trunc((ImWidth / Image1.Width) * Image1.Height);
- { Print the bitmap }
- Printer.Canvas.StretchDraw(Rect(0, 0, ImWidth, ImHeight),
- Image1.Picture.Graphic);
- finally
- Printer.EndDoc; // End the print job
- end;
- end;